import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/login/Login.vue'
import Welcome from "../views/Welcome";
import Menu from "../views/menu/Menu";
import Error404 from "../components/404/Error404";
import SysUser from "../views/System/SysUser";
import SysDept from "../views/System/SysDept";
import SysRole from "../views/System/SysRole";
import SysLoginLog from "../views/System/SysLoginLog";
Vue.use(VueRouter)

const routes = [
    {
        path: '/Error404',
        name:'404',
        //hidden: true,
        component:Error404,
        meta:{
            role:["*"],
        },
    },

    {
        path: '/login',
        component: Login ,
        hidden: true,
    },

    {
        path: '/',
        component: Home,
        name: '系统管理',
        iconCls: 'el-icon-s-operation',//图标样式class
        children: [
            {
                path: '/Welcome',
                component: Welcome,
                name: '欢迎页面',
                childrenMenuIcon:'el-icon-s-operation',
            },
            {
                path: '/sys/user',
                component: SysUser,
                name: '用户',
                childrenMenuIcon:'el-icon-s-operation',
            },
            {
                path: '/sys/menu',
                component: Menu,
                name: '菜单',
                childrenMenuIcon:'el-icon-s-operation',
            },
            {
                path: '/sys/dept',
                component: SysDept,
                name: '部门',
                childrenMenuIcon:'el-icon-s-operation',
            },
            {
                path: '/sys/role',
                component: SysRole,
                name: '角色',
                childrenMenuIcon:'el-icon-s-operation',
            },
            {
                path: '/sys/loginlog',
                component: SysLoginLog,
                name: '登陆日志',
                childrenMenuIcon:'el-icon-s-operation',
            },
        ]
    },

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
});

export default router
